package com.crm.entity;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "opportunity")
public class Opportunity implements Serializable {
	
	private static final long serialVersionUID = 1L;


	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")
	@Column(name="id")
	
	private int id;
	
	
	private String status;
	@Column(name="exec_name", length=100)
	private String execName;

	private String application;

	private String curencytype;

	
	@ManyToOne
	@JoinColumn(name="CLIENT_ID")
	private Clientdet clientId;

	private Integer probability;
	
	@Column(length=100)
	private String organisation;

	private String enquiryname;

	private Date duedate;

	private String enqnum;
	
	@Column(name="proj_name", length=100)
	private String projName;

	private String user;

	private String enquirytype;

	private String division;
	
	
	@Column(name="ref_num", length=100)
	private String refNum;

	private Date curr_date;
	
	@Column(name="price_bid")
	private Boolean Pricebid;
	
	@Column(name="tech_bid")
	private Boolean Technicalbid;
	
	@Column(name="warranty")
	private Boolean warranty;
	
	public Boolean getWarranty() {
		return warranty;
	}


	public void setWarranty(Boolean warranty) {
		this.warranty = warranty;
	}


	private Boolean is_src_completed;
	
	
	
	private String remarks;
	

	@OneToMany(fetch=FetchType.LAZY,cascade = CascadeType.ALL)
	@JoinColumn(name = "enqid",  referencedColumnName = "id")
	private List<Parts> partsset = new ArrayList<Parts>() ;



	

	
	@ManyToOne
	@JoinColumn(name="BUSINESS_ID")
	private Business businessId;
	

	public Business getBusinessId() {
		return businessId;
	}


	public void setBusinessId(Business businessId) {
		this.businessId = businessId;
	}


	public Opportunity() {
	}


	public Opportunity(Business busid,String org, String div, String user, String eqtype,
			String eqNo,String refno, Boolean techBid, Boolean priceBid,Boolean warranty, java.sql.Date date, java.sql.Date cdate,
			int probability, String projName,Clientdet clientId, String executive,
			String quotCurr, String opprName,String status) {
		this.businessId=busid;
		this.organisation=org;
		this.division=div;
		this.user=user;
		this.enquirytype=eqtype;
		this.enqnum=eqNo;
		this.refNum=refno;
		this.Technicalbid=techBid;
		this.Pricebid=priceBid;
		this.warranty=warranty;
		this.duedate=date;
		this.curr_date=cdate;
		this.probability=probability;
		this.projName=projName;
		this.clientId=clientId;
		this.execName=executive;
		this.curencytype=quotCurr;
		this.enquiryname=opprName;
		this.status=status;
		
		
	}
	public Opportunity(int opid,Business busid,String org, String div, String user, String eqtype,
			String eqNo,String refno, Boolean techBid, Boolean priceBid,Boolean warranty, java.sql.Date date, java.sql.Date cdate,
			int probability, String projName, Clientdet clientId, String executive,
			String quotCurr, String opprName,String status) {
		this.id=opid;
		this.businessId=busid;
		this.organisation=org;
		this.division=div;
		this.user=user;
		this.enquirytype=eqtype;
		this.enqnum=eqNo;
		this.refNum=refno;
		this.Technicalbid=techBid;
		this.Pricebid=priceBid;
		this.warranty=warranty;
		this.duedate=date;
		this.curr_date=cdate;
		this.probability=probability;
		this.projName=projName;
		this.clientId=clientId;
		this.execName=executive;
		this.curencytype=quotCurr;
		this.enquiryname=opprName;
		this.status=status;
		
		
	}

	
	
	

	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}





	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getExecName() {
		return this.execName;
	}

	public void setExecName(String execName) {
		this.execName = execName;
	}

	
	public String getApplication() {
		return this.application;
	}

	public void setApplication(String application) {
		this.application = application;
	}

	
	public String getCurencytype() {
		return this.curencytype;
	}

	public void setCurencytype(String curencytype) {
		this.curencytype = curencytype;
	}

	


	public Clientdet getClientId() {
		return clientId;
	}


	public void setClientId(Clientdet clientId) {
		this.clientId = clientId;
	}


	public Integer getProbability() {
		return this.probability;
	}

	public void setProbability(Integer probability) {
		this.probability = probability;
	}

	
	public String getOrganisation() {
		return this.organisation;
	}

	public void setOrganisation(String organisation) {
		this.organisation = organisation;
	}

	
	public String getEnquiryname() {
		return this.enquiryname;
	}

	public void setEnquiryname(String enquiryname) {
		this.enquiryname = enquiryname;
	}

	public Date getDuedate() {
		return this.duedate;
	}

	public void setDuedate(Date date) {
		this.duedate = date;
	}

	
	public String getEnqnum() {
		return this.enqnum;
	}

	public void setEnqnum(String enqnum) {
		this.enqnum = enqnum;
	}

	
	public String getProjName() {
		return this.projName;
	}

	public void setProjName(String projName) {
		this.projName = projName;
	}

	
	public String getUser() {
		return this.user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	
	public String getEnquirytype() {
		return this.enquirytype;
	}

	public void setEnquirytype(String enquirytype) {
		this.enquirytype = enquirytype;
	}

	
	public String getDivision() {
		return this.division;
	}

	public void setDivision(String division) {
		this.division = division;
	}

	
	public String getRefNum() {
		return this.refNum;
	}

	public void setRefNum(String refNum) {
		this.refNum = refNum;
	}


	/*public long getAmount() {
		return this.amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}*/


	
	
	
	public List<Parts> getPartsset() {
		return partsset;
	}


	public void setPartsset(List<Parts> parts) {
		this.partsset = parts;
	}


	public Date getCurr_date() {
		return curr_date;
	}


	public void setCurr_date(Date curr_date) {
		this.curr_date = curr_date;
	}


	public Boolean getPricebid() {
		return Pricebid;
	}


	public void setPricebid(Boolean pricebid) {
		Pricebid = pricebid;
	}


	public Boolean getTechnicalbid() {
		return Technicalbid;
	}


	public void setTechnicalbid(Boolean technicalbid) {
		Technicalbid = technicalbid;
	}


	public Boolean getIs_src_completed() {
		return is_src_completed;
	}


	public void setIs_src_completed(Boolean is_src_completed) {
		this.is_src_completed = is_src_completed;
	}


	public String getRemarks() {
		return remarks;
	}


	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}


	

}
